{% extends "base.html" %}
{% block app_content %}
    <div class="page-header">
        <h3>openEuler Hardware Compatibility Test</h3>
        <br>
    </div>

    <div class="page-header">
        <table class="table table-striped table-hover">
            <thead>
            <th colspan="2">Environment</th>
            </thead>
            <tbody>
            {% for key in info %}
                <tr>
                    <td width="50%">{{ key }}</td>
                    <td>{{ info.get(key) }}</td>
                </tr>
            {% endfor %}
            </tbody>
        </table>
    </div>

    <div class="page-header">
        <table class="table table-striped table-hover">
            <thead>
            <th>Testcase</th>
            <th>Device</th>
            <th>Result</th>
            </thead>
            <tbody>
            {% for d in results %}
                <tr>
                    {% set int = d.get("device").get("INTERFACE", "") %}

                    {% if int %}
                        {% set testcase = d.get("name") + "-" + int %}
                    {% else %}
                        {% set testcase = d.get("name") %}
                    {% endif %}

                    {% if d.get("run") %}
                        {% set result = d.get("status") %}
                    {% else %}
                        {% set result = "" %}
                    {% endif %}

                    <td>{{ testcase }}</td>
                    <td>{{ int }}</td>
                    <td>
                        <a href="/results/{{ manu }}/{{ hardware }}/{{ task_id }}/{{job }}/logs/{{ testcase }}">{{ result }}</a>
                    </td>
                </tr>
            {% endfor %}
            </tbody>
        </table>
    </div>
{% endblock %}
